home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Invisible Universe
/
Invisible Universe (1995)(Voyager)[Mac-PC].iso
/
mac
/
UNIVERSE
/
SHARED.DIR
/
01008_Script_co-only
< prev
next >
Wrap
Text File
|
1995-11-21
|
18KB
|
851 lines
on nextPage
global gCurrChan
if isReal(gCurrChan) then go (the frame)+1
end
on prevPage
global gCurrChan
if isReal(gCurrChan) then go (the frame)-1
end
on openPopMenu
global gOpenPopMenu
if gOpenPopMenu then exit
set gOpenPopMenu = 1
--put ">>> openPopMenu"
if the machineType = 256 then
--
--
-- Make sure that the search path is used for this
-- (works for mac, but not for PC)
--
--openXLib "POPMENU.DLL"
else
--openXLib "PopUp Menu XObj"
openXLib "HierPopUp.XFCN"
end if
end openPopMenu
-- pop last through nth
on popRetraceMenuOLD N
global gRetraceLabelList -- , gTOCRetraceChan
global gRetraceCount, gRetraceLabelLongForm
--put ">>>popRetraceMenu"
repeat with i = 1 to N
if gRetraceCount = 0 then exit
deleteAt(gRetraceLabelList, gRetraceCount)
delete line gRetraceCount of gRetraceLabelLongForm
set gRetraceCount = gRetraceCount - 1
end repeat
--set the visibility of sprite gTOCRetraceChan = (gRetraceCount > 0)
end popRetraceMenuOld
on rotateRetraceMenu
global gRetraceLabelList -- , gTOCRetraceChan
global gRetraceCount, gRetraceLabelLongForm
--put ">>>popRetraceMenu"
if gRetraceCount = 0 then exit
set lab = getAt(gRetraceLabelList, gRetraceCount)
deleteAt(gRetraceLabelList, gRetraceCount)
addAt(gRetraceLabelList, 1, lab)
set desc = (line gRetraceCount of gRetraceLabelLongForm) & RETURN
delete line gRetraceCount of gRetraceLabelLongForm
put desc before line 1 of gRetraceLabelLongForm
--set the visibility of sprite gTOCRetraceChan = (gRetraceCount > 0)
end rotateRetraceMenu
--
--
-- Just pop a single entry at N
--
on popRetraceMenu N
global gRetraceLabelList -- , gTOCRetraceChan
global gRetraceCount, gRetraceLabelLongForm
--put ">>>popRetraceMenu"
if gRetraceCount = 0 then exit
deleteAt(gRetraceLabelList, N)
delete line N of gRetraceLabelLongForm
set gRetraceCount = gRetraceCount - 1
--set the visibility of sprite gTOCRetraceChan = (gRetraceCount > 0)
end popRetraceMenu
on retrace quickP
global gRetraceLabelList, gRetraceLabelLongForm, gLabels, gSuppPhoto
global gRetraceCount, gRetraceInProgress
--put ">>> quickP = " & quickP
if voidP(quickP) then
set quickP = 0
end if
if gRetraceCount = 0 then
beep
repeat while the mouseDown
end repeat
exit
end if
if not quickP then
--
--
-- Give the user some time to let go of the mouse
--
if the mouseDown then
set t = the ticks + 30
repeat while the mouseDown and (t > the ticks)
end repeat
end if
end if
if not (the mouseDown) or quickP then
-- return to the last item
--put ">>>quick jump"
if voidP(gRetraceLabelList) then exit
if gRetraceCount = 0 then exit
--
--
-- Treat the CO menu as a special menu... on retrace, skip
-- an extra level and go back to the TOC
--
set lab = the frameLabel
set myLabelName = getAt(gRetraceLabelList, gRetraceCount)
if the movie <> "FIND.DIR" then
if the frameLabel = "" then
set same = addToRetrace(gCurLabelProp)
else
set same = addToRetrace()
end if
end if
--put ">>>" & gRetraceLabelList & RETURN & gRetraceLabelLongForm
set gRetraceInProgress = 1
goGo(myLabelName, 1)
set gRetraceInProgress = 0
--put "about to exit"
exit
end if
--put ">>>long jump"
--
--
-- Make a pop up menu
--
set pmenu = line 1 to count(gRetraceLabelList) of gRetraceLabelLongForm
-- dmd make this work... the PopMenu returns unknown handler
--put ">>> making a popup cast 1008"
if the machineType = 256 then
set setVis = 0
if the movie = "TOUR.DIR" or the movie = "MOVIES.DIR" then
if the type of sprite 12 = 16 then
set setVis = 1
set the visibility of sprite 12 = 0
end if
end if
set n = the number of lines of pMenu
set n = n * 17
set choice = doDMDPopMenu(pmenu, the mouseH-30, 440-n, 0)
if setVis then
set the visibility of sprite 12 = 1
end if
--put ">>> choice is " choice
else
--put ">>> (1008) popup menu of: " & pmenu
set n = the number of lines of pMenu
set n = n * 15
set choice = HPopUpMenu(pmenu, 0, 440-n, the mouseH-30)
--put ">>> popup choice = " & quote & choice & quote && stringP(choice) && integerP(choice)
if choice = 0 then exit
set choice = integer(item 3 of choice)
--put ">>> popup choice = " & quote & choice & quote && stringP(choice) && integerP(choice)
end if
if choice = 0 then exit
set myLabelName = getAt(gRetraceLabelList, choice)
--put ">>> label = " & myLabelName
if the frameLabel = "" then
addToRetrace gCurLabelProp
else
addToRetrace
end if
--put ">>>" & gRetraceLabelList & RETURN & gRetraceLabelLongForm
set gRetraceInProgress = 1
goGo(myLabelName, 1)
set gRetraceInProgress = 0
end
on doContents quickP
--put ">>> quickP = " & quickP
if voidP(quickP) then
set quickP = 0
end if
if not quickP then
--
--
-- Give the user some time to let go of the mouse
--
if the mouseDown then
set t = the ticks + 30
repeat while the mouseDown and (t > the ticks)
end repeat
end if
end if
if not (the mouseDown) or quickP then
-- return to the last item
--put ">>>quick contents"
global gCurLabelProp
if the movie = "POETRY.DIR" then stopPoem
if the frameLabel = "" then
addToRetrace gCurLabelProp
else
addToRetrace
end if
--dmd141195 DoGo "TOC", "TOC.DIR"
GoGo("TOCM")
-- put ">>>about to exit"
exit
end if
--put ">>>long jump"
--
--
-- Make a pop up menu
--
set pmenu = field "Contents PopUp"
--put ">>> making a popup cast 1008"
if the machineType = 256 then
-- set myPopup = PopMenu(mNew,pmenu,623)
-- myPopUp(mSetItemMark,0)
--put myPopup
-- repeat while the mouseDown
set n = the number of lines of pMenu
set n = n * 17
-- set choice = myPopup(mPopNum, the mouseH-30, 440-n, 0)
if the movie = "TOUR.DIR" or the movie = "MOVIES.DIR" then
if the type of sprite 12 = 16 then
set setVis = 1
set the visibility of sprite 12 = 0
end if
end if
set choice = doDMDPopMenu(pmenu, the mouseH-30, 440-n, 0)
if setVis then
set the visibility of sprite 12 = 1
end if
--put ">>> Choice is: " & choice
-- end repeat
--myPopup(mDispose)
else
--put ">>> (1008) popup menu of: " & pmenu
set n = the number of lines of pMenu
set n = n * 14
set choice = HPopUpMenu(pmenu, 0, 440-n, the mouseH-30)
--put ">>> popup choice = " & quote & choice & quote && stringP(choice) && integerP(choice)
if choice = 0 then exit
set choice = integer(item 3 of choice)
--put ">>> popup choice = " & quote & choice & quote && stringP(choice) && integerP(choice)
end if
if choice = 0 then exit
set command = line choice of field "Contents Popup Commands"
--put ">>> contents popup is doing:" & command
do command
end
on DoGo myLabelName, myMovieName
global gCurHist, gCurData, gCom, gNavPalette
global gTOCRetraceChan, gRetraceCount
--put ">>>dogo " & myLabelName && myMovieName && " from " && the movieName
if gCurHist=0 then unGrayHist
if gCurData=0 then unGrayData
-- if gCom then moveToBack gNavPalette
if gCom then tell gNavPalette to lCloseNavPalette(1)
updateStage
--put ">>>contents, at label: " & the frameLabel & " goto : " & myMovieName && myLabelName
if gCom then go to objectLabel()
--put ">>> going to black frame from DoGo in 1008"
--puppetTransition 50, 20, 8, 0
--puppetTransition 50, 20, 8, 1
go to label ("Black Frame")
set the visibility of sprite gTOCRetraceChan = (gRetraceCount > 0)
--put ">>> retrace button is: " & (gRetraceCount > 0)
if char 1 of myMovieName = "O" then
alert "Internal error 1008-435"
exit
else
--puppetTransition 50, 20, 8, 0
--puppetTransition 50, 20, 8, 1
if myMovieName = the movieName then
go to frame myLabelName
else
hideButtons
updateSTage
go to frame myLabelName of movie myMovieName
end if
end if
end DoGo
on goTour
global gTourLabel, gTourTimeSS, gTourTimeMW, gTourTimeCL
global gCurLabelProp, gLabels
set mainLabel = getMainView(string(gCurLabelProp))
set mainList = getAProp(gLabels, mainLabel)
set tourList = getProp(getAt(mainList, 3), #TOUR)
set gTourLabel = getAt(tourList, 1) & "S"
do "set gTourTime" & getAt(TourList,1) & " = " & getAt(tourList, 2)
goGo(gTourLabel)
end
on getMainView label
global gNonVisibleSingles
if ((char 5 of label = "V") or (getOne(gNonVisibleSingles, char 1 to 5 of label) > 0)) then
return char 1 to 5 of label
else
return (char 1 to 4 of label) & "V"
end if
end getMainView
on prevCo
global gCurLabelProp, gO, gNonVisibleSingles, gPrevNextCo
set itemIndex = getPos(gO, getaprop(gO, gCurLabelProp))
--put ">>> item: " & gCurLabelProp & " is at position: " & itemIndex
if itemIndex <= 0 then exit
set oldItem = string(gCurLabelProp)
repeat while 1
set itemIndex = itemIndex - 1
if itemIndex = 0 then set itemIndex = count(gO)
set newProp = string(getPropAt(gO, itemIndex))
--put ">>>The new prop (screen) is: " & newProp
if ((char 5 of newProp = "V") or (getOne(gNonVisibleSingles, newProp) > 0)) and ¼
char 1 to 4 of newProp <> char 1 to 4 of oldItem and ¼
(the number of chars in newProp <= 5) then ¼
exit repeat
end repeat
--put ">>> Going to here: " & getPropAt(gO, itemIndex)
set gPrevNextCo = 1
goGo(getPropAt(gO, itemIndex))
set gPrevNextCo = 0
end
on nextCo
global gCurLabelProp, gO, gNonVisibleSingles, gPrevNextCo
set itemIndex = getPos(gO, getaprop(gO, gCurLabelProp))
--put ">>> item: " & gCurLabelProp & " is at position: " & itemIndex
if itemIndex <= 0 then exit
set oldItem = string(gCurLabelProp)
set listSize = count(gO)
repeat while 1
if itemIndex = listSize then
set itemIndex = 1
else
set itemIndex = itemIndex + 1
end if
set newProp = string(getPropAt(gO, itemIndex))
--put ">>>The new prop (screen) is: " & newProp
if ((char 5 of newProp = "V") or (getOne(gNonVisibleSingles, newProp) > 0)) and ¼
char 1 to 4 of newProp <> char 1 to 4 of oldItem and ¼
(the number of chars in newProp <= 5) then ¼
exit repeat
end repeat
--put ">>> Going to here: " & getPropAt(gO, itemIndex)
set gPrevNextCo = 1
goGo(getPropAt(gO, itemIndex))
set gPrevNextCo = 0
end
on infoToggle
if the visibility of sprite 6 = 1 then
infoClose
else
hideHotSpots
infoOpen
end if
end
--
--
-- DMD: Yes, these constants are troubling, but have no time now to correct
-- the problem and lack of structure here, will just hack more and get by for now.
-- Sorry. (Chuck left some GREAT stuff and some okay stuff)
--
on infoOpen
global gCom, gInfoVis
set gInfoVis = 1
repeat with i = 6 to 10
set the visible of sprite i to true
end repeat
repeat with i = 26 to 29
set the visible of sprite i to true
end repeat
-- set the visible of sprite 30 = not(gCOM) or the castNum of sprite 7 > 0
-- --put ">>>sprite 30 is visible?" && the visibility of sprite 30
goMainView
end
on toggleName
set the visibility of sprite 5 = not the visibility of sprite 5
end toggleName
on showName
set the visibility of sprite 5 = 1
end showName
on hideName
set the visibility of sprite 5 = 0
end hideName
on infoCloseButton
--global gSuppPhoto
--if gSuppPhoto then hideName
infoClose
end infoCloseButton
on infoClose
global gInfoVis
if the visibility of sprite 6 = 0 then
set gInfoVis = 0
else
set gInfoVis = 0
repeat with i = 6 to 10
set the visible of sprite i to false
end repeat
repeat with i = 26 to 30
set the visible of sprite i to false
end repeat
end if
end
on infoDesc
cursor 4
goMainView
cursor -1
end
on GrayHistData
-- puppetSprite 28, 1
-- puppetSprite 29, 1
-- set the ink of sprite 28 = 34
-- set the ink of sprite 29 = 34
end
on GrayHist
puppetSprite 28, 1
set the castNum of sprite 28 = 1087
end
on GrayData
puppetSprite 29, 1
set the castNum of sprite 29 = 1090
end
on UnGrayHist
global gCurHist
set gCurHist = -1
puppetSprite 28,0
end
on UnGrayData
global gCurData
set gCurData = -1
puppetSprite 29,0
end
--
--
-- To be called from the first frame of a section (the label + 1)
--
on setupHistandDataEtc
global gCurHist, gCurData, gTSLabels, gTSEnabled
--put ">>> setupHistandDataEtc frame =" && the frame
set gTSLabels = [:]
set gTSEnabled = 0
set the mouseDownScript to empty
--
--
-- If Channel 7 is empty then hide channel 30, it's cover button
--
-- set the visibility of sprite 30 = ¼
the castnum of sprite 7 > 0 and the visibility of sprite 7
set lab = objectLabel()
if (label(lab)+1) <> the frame then
set gCurHist = 0
set gCurData = 0
GrayHistData
exit
end if
--
--
-- Find the main label in the label list
--
set off = offset(lab, the labelList)
if off = 0 then
set gCurHist = 0
set gCurData = 0
GrayHistData
exit
end if
set off = off + length(lab) + 1
set markerOffset = 1
--put ">>> chars: " & char off to (off+1) of the labelList
--
--
-- Find the History (H) label
--
if char off to (off+1) of the labelList = "H" & RETURN then
UnGrayHist
set gCurHist = marker(markerOffset)
set markerOffset = markerOffset + 1
set off = off + 2
else
GrayHist
set gCurHist = 0
end if
-- --put ">>> chars: " & char off to (off+1) of the labelList
--
--
-- Find the Data (D) label
--
if char off to (off+1) of the labelList = "D" & RETURN then
unGrayData
set gCurData = marker(markerOffset)
set markerOffset = markerOffset + 1
set off = off + 2
else
GrayData
set gCurData = 0
end if
--
--
-- Find any TS labels... (TSx)
--
repeat with i = 1 to 11
--put ">>>" & char off to (off+1) of the labelList
if char off to (off+1) of the labelList = "TS" then
setAProp gTSLabels, i, marker(markerOffset)
set markerOffset = markerOffset + 1
set off = off + 4
else
exit repeat
end if
end repeat
end
--
--
-- Check the next label in the label list, if H, then go there.
--
on infoHist
global gCurHist
if gCurHist <= 0 then
beep
else
cursor 4
go to gCurHist
cursor -1
end if
end
--
--
-- Similar to infoHist.
--
on infoData
global gCurData
if gCurData <= 0 then
beep
else
cursor 4
go to gCurData
cursor -1
end if
end
on closeUp whichOne
if voidP(whichOne) then put empty into whichOne
set the mouseUpScript to "myReturn"&&(the frame)
put label(objectLabel()&"C"&string(WhichOne)) into whereTo
go frame label(whereTo)
puppetPalette "Black",30,(the frame)
repeat while not(the mouseDown)
end repeat
end
on hotSpot whichOne
set the mouseUpScript to "myReturn"&&(the frame)
go frame label("TS"&string(WhichOne))
end
on goMainView
set the mouseUpScript to ""
go frame label(objectLabel())+1
end goMainView
on objectLabel
if the castNum of sprite 1 = 0 then
set it = the frameLabel
else
put the name of cast(the castnum of sprite 1) into it
put char 1 to offset(".",it)-1 of it into it
end if
return it
end objectLabel
on myReturn toWhere
go frame toWhere
set the mouseUpScript to ""
end myReturn
on scrolpe s
global gHotSpotList, gTSLabels
if the movie = "OCOMETS.DIR" and the frame = 35 and s = 14 then
global gNavPalette, gNavOffScreen
if not gNavOffScreen then tell gNavPalette to lCloseNavPalette(1)
hideButtons
hideHotSpots
infoClose
go to label("SIMPIC")
set the movierate of sprite 33 = 1
startTimer
exit
end if
--put "clicked sprite = " & s
set i = getAProp(gHotSpotList, s)
if voidP(i) then
beep
exit
end if
if i < 0 then
-- text
set f = getAProp(gTSLabels, -i)
go to frame f
else
-- close up
set lab = objectLabel() & "C"
if i > 1 then set lab = lab & string(i)
goGo(lab)
end if
end scrolpe
on DrFiorellaTerenzi
global gHelpMovie, gCom, gNavPalette, gTSEnabled
if gCom then
infoClose
hideButtons
hideHotSpots
if gTSEnabled then
set gTSEnabled = 0
goMainView
end if
tell gNavPalette to lCloseNavPalette(1)
end if
-- puppetSprite 48,0
-- updateStage
set gHelpMovie = the castNum of sprite 48
playhelp
end DrFiorellaTerenzi